import zrender from 'zrender/zrender'
import Isogon from 'zrender/graphic/shape/Isogon'

export default {
  mounted() {
    let zr = zrender.init(this.$refs.chart)
    let isogon = new Isogon({
      shape: {
        x : 300,
        y : 320,
        r : 70,
        n : 9,
      },
      style: {
        brushType : 'both',
        fill : 'red', // color.getColor(colorIdx++),          // rgba supported
        stroke: 'blue', // color.getColor(colorIdx++),   // getColor from default palette
        lineWidth : 9,
        text :'正n边形',
        textPosition :'inside'
      },
      hoverable : true,   // default true
      draggable : true
    })
    zr.add(isogon)
  },

  render(h) {
    return (
      <div class="page">
        <div ref="chart" style="width: 100%; height: 600px"></div>
      </div>
    )
  }
}
